﻿//using System;
//using System.Collections.Generic;
//using System.ComponentModel;
//using System.Net;
//using System.IO;
//using System.Runtime.InteropServices;
//using System.Security.Permissions;
//using System.Text;
//using Pibby.Core.IO;

//namespace Pibby.Core.Tests.Stubs
//{
//    public class FileCopier : ICopyFiles
//    {
//        #region Public Attributes

//        public bool CallsToFileExistsFail;
//        public bool FileExistsCalled;
//        public bool CallsToFolderExistsFail;
//        public bool FolderExistsCalled;
//        public bool ListContentsOfCalled;
//        public bool CopyCalled;
//        public bool EnsurePathExistsCalled;
//        public bool DeleteCalled;
//        public string LastPathName;

//        public long UsedSpaceReported;
//        public long AvailableSpaceReported;

//        public List<string> CopiedFiles = new List<string> ();

//        #endregion

//        #region Events

//        public event EventHandler<ProgressEventArgs> CopyProgressChanged;
//        public event EventHandler CopyCompleted;

//        #endregion

//        #region Methods

//        public void ListContentsOf(IFolder folder, IFileSystemVisitor visitor)
//        {
//            this.ListContentsOfCalled = true;
//            //this.LastPathName = location;

//            visitor.Entering(folder);

//            for (int i = 0; i < 10; ++i)
//            {
//                //visitor.Visit(string.Format("File{0}.mp3", i + 1), i * 10);
//            }

//            visitor.Leaving(folder);
//        }

//        public bool FileExists(string path)
//        {
//            this.FileExistsCalled = true;
//            this.LastPathName = path;

//            return !this.CallsToFileExistsFail;
//        }

//        public bool FolderExists(string path)
//        {
//            this.FolderExistsCalled = true;
//            this.LastPathName = path;

//            return !this.CallsToFolderExistsFail;
//        }

//        public void Copy(string source, string target)
//        {
//            this.CopyCalled = true;

//            for (int i = 0; i < 100; ++i)
//            {
//                EventHandler<ProgressEventArgs> progress = CopyProgressChanged;

//                if (progress != null)
//                    progress(this, new ProgressEventArgs(i + 1));
//            }

//            this.CopiedFiles.Add(target);

//            EventHandler complete = CopyCompleted;

//            if (complete != null)
//                complete(this, EventArgs.Empty);
//        }

//        public void Delete(string path)
//        {
//            this.DeleteCalled = true;
//            this.LastPathName = path;
//        }

//        public void EnsurePathExists(string path)
//        {
//            this.EnsurePathExistsCalled = true;
//            this.LastPathName = path;
//        }

//        public long UsedSpace(string location)
//        {
//            this.LastPathName = location;
//            return this.UsedSpaceReported;
//        }

//        public long AvailableSpace(string location)
//        {
//            this.LastPathName = location;
//            return this.AvailableSpaceReported;
//        }

//        #endregion
//    }

//}
